package com.lagou.homework.filter;

import com.alibaba.dubbo.common.extension.Activate;
import com.alibaba.dubbo.rpc.*;

@Activate
public class TransportIPFilter implements Filter {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        String webServerIP = RpcContext.getContext().getLocalHost();
        RpcContext.getContext().setAttachment("ip", webServerIP);
        System.out.println("=======>"+webServerIP);
        return  invoker.invoke(invocation);
    }
}
